#include "meshForEachCell.hpp"

namespace hms
{

#define FOR_EACH(NAME, CELLS, INDEX_ONLY, IN_PARALLEL_REGION) \
template<typename MeshType> \
template<typename Callable> \
void MeshBase<MeshType>::forEach##NAME( Callable&& func ) const { \
	hms::forEachCell<WhichCells::CELLS, INDEX_ONLY, IN_PARALLEL_REGION>( \
		this->derived(), std::forward<Callable>(func) \
	); \
}

FOR_EACH(Cell, all, false, false)
FOR_EACH(Cell_noNesting, all, false, true)
FOR_EACH(CellIndex, all, true, false)
FOR_EACH(CellIndex_noNesting, all, true, true)
FOR_EACH(DomainCell, domain, false, false)
FOR_EACH(DomainCell_noNesting, domain, false, true)
FOR_EACH(DomainCellIndex, domain, true, false)
FOR_EACH(DomainCellIndex_noNesting, domain, true, true)
FOR_EACH(GhostCell, ghost, false, false)
FOR_EACH(GhostCell_noNesting, ghost, false, true)
FOR_EACH(GhostCellIndex, ghost, true, false)
FOR_EACH(GhostCellIndex_noNesting, ghost, true, true)

#undef FOR_EACH

} // end namespace hms
